package com.qf.web.service.impl;

import com.qf.web.common.R;
import com.qf.web.dao.StudentDao;
import com.qf.web.dao.impl.StudentDaoImpl;
import com.qf.web.pojo.Student;
import com.qf.web.service.StudentService;
import com.qf.web.vo.BarVo;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentDao studentDao = new StudentDaoImpl();
    @Override
    public R<List<Student>> getPageData(int page, int pageSize, Student student) {
        R<List<Student>> r = new R();
     List<Student> pageData= studentDao.getOageData(page, pageSize, student);

     long count = studentDao.getStudentsCount(student);
        r.setCode(0);
        r.setData(pageData);
        r.setMsg("学生分页查询");
        r.setCount(count);

        return r;

    }

    @Override
    public int deleteStudentById(int id) {
        return studentDao.deletStudentById(id);
    }

    @Override
    public int updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public int AddStudent(Student student) {
        return studentDao.AddStudent(student);
    }

    @Override
    public BarVo seclctSexList() {
        return studentDao.selectSexList();
    }


}
